#include <iostream>
using namespace std;

int main() {

	int x,h;
	cout << "Nhap x: ";
	cin >> x;
	cout << "Nhap bit can kiem tra: ";
	cin >> h;
	if ((1 << h - 1) == (x & (1 << h - 1))){
		cout << "bit la 1\n";
	}
	else {
		cout << "bit la 0\n";
	}
	
	return 0;

}